package com.xuecheng.teaching.controller;

import com.xuecheng.commons.model.dto.PageRequest;
import com.xuecheng.commons.model.dto.WorkCommitDto;
import com.xuecheng.commons.model.dto.WorkRecordDto;
import com.xuecheng.commons.model.vo.ResponseResult;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;
import com.xuecheng.teaching.service.WorkRecordService;
import lombok.extern.slf4j.Slf4j;
import org.springframework.beans.factory.annotation.Autowired;

/**
 * <p>
 * 作业提交记录前端控制器
 * </p>
 *
 * @author itheima
 */
@Slf4j
@RestController
public class WorkRecordController {

    @Autowired
    private WorkRecordService workRecordService;



    //  添加或修改作业记录--学员
    @PostMapping("/work-record")
    public ResponseResult saveOrUpdateRecord(@RequestBody WorkRecordDto workRecordDto){
        return workRecordService.saveOrUpdateRecord(workRecordDto);
    }

    // 批阅详情-作业列表
    @PostMapping("/workpage/teachplan")
    public ResponseResult workPage(PageRequest params,Long teachplanId){
        return workRecordService.workPage(params,teachplanId);
    }
}
